package com.moarea.app.service.impl.common;

import com.moarea.app.dao.BaseBillnoMapper;
import com.moarea.app.lang.model.ResultObject;
import com.moarea.app.service.abst.ABillBaseService;
import com.moarea.app.service.inter.common.ICommonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 公共service
 * <p>
 * jizhong
 * <p>
 * 2017-11-03
 */
@Service(value = "commonService")
public class CommonService extends ABillBaseService implements ICommonService {

    @Autowired
    private BaseBillnoMapper baseBillnoMapper;

    /**
     * 获取最新的BillNo
     *
     * @param param 参数
     * @return 单号
     */
    @Override
    public ResultObject obtainBillNo(Map<String, Object> param) {
        baseBillnoMapper.obtainBillNo(param);
        return ResultObject.createInstance(param.get("ACODE") != null,
                param.get("ACODE") != null ? "成功" : "失败",
                param.get("ACODE") != null ? param.get("ACODE").toString() : "");

    }
}
